Parameters
- key
BPlusTree/BPlusTree.Test/BasicTestsVersion2.cs
C# | Copy Code |
---|---|
using (BPlusTree<int, string> tree = Create(Options)) { tree.EnableCount(); Assert.AreEqual(0, tree.Count); tree.Rollback(); Assert.AreEqual(0, tree.Count); tree.Commit(); Assert.AreEqual(0, tree.Count); tree.Add(1, "A"); tree.Rollback(); Assert.AreEqual(0, tree.Count); tree.Commit(); Assert.AreEqual(0, tree.Count); tree.Add(1, "A"); tree.Commit(); Assert.AreEqual(1, tree.Count); tree.Rollback(); Assert.AreEqual(1, tree.Count); tree.Add(2, "B"); tree.Rollback(); Assert.AreEqual(1, tree.Count); tree[1] = "abc"; tree.Commit(); Assert.AreEqual(1, tree.Count); tree.Rollback(); Assert.AreEqual("abc", tree[1]); Assert.IsFalse(tree.ContainsKey(2)); } |
VB.NET | Copy Code |
---|---|
Using tree As BPlusTree(Of Integer, String) = Create(Options) tree.EnableCount() Assert.AreEqual(0, tree.Count) tree.Rollback() Assert.AreEqual(0, tree.Count) tree.Commit() Assert.AreEqual(0, tree.Count) tree.Add(1, "A") tree.Rollback() Assert.AreEqual(0, tree.Count) tree.Commit() Assert.AreEqual(0, tree.Count) tree.Add(1, "A") tree.Commit() Assert.AreEqual(1, tree.Count) tree.Rollback() Assert.AreEqual(1, tree.Count) tree.Add(2, "B") tree.Rollback() Assert.AreEqual(1, tree.Count) tree(1) = "abc" tree.Commit() Assert.AreEqual(1, tree.Count) tree.Rollback() Assert.AreEqual("abc", tree(1)) Assert.IsFalse(tree.ContainsKey(2)) End Using |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7